package com.simplegui.api;

import java.util.HashSet;
import java.util.Set;

public abstract class Game {

	private Set<GameComponent> gameComponents;
	
	public abstract void configureFrame(Frame frame);
	
	public Game() {
		gameComponents = new HashSet<>();
	}
	
	public void executeLogic(){
		for (GameComponent gameComponent : gameComponents) {
			gameComponent.executeLogic();
		}
	}
	
	public boolean addGameComponent(GameComponent gameComponent){
		return gameComponents.add(gameComponent);
	}
	
	public void removeGameComponent(GameComponent gameComponent){
		gameComponents.remove(gameComponent);
	}
	
}
